home *** CD-ROM | disk | FTP | other *** search
/ Champak 146 / (Vol 146) Jan 07 2012.iso / Games / sheep_escape.swf / scripts / DefineSprite_72 / frame_1 / DoAction_2.as next >
Encoding:
Text File  |  2012-01-07  |  1.6 KB  |  75 lines

  1. function timerFunk()
  2. {
  3.    if(pickup)
  4.    {
  5.       freeze = microtime;
  6.       pickUp = 0;
  7.    }
  8.    if(reset)
  9.    {
  10.       freeze = 0;
  11.       time = atime.join("");
  12.       reset = 0;
  13.    }
  14.    if(timerOn)
  15.    {
  16.       if(check)
  17.       {
  18.          timeBase = getTimer();
  19.          check = 0;
  20.       }
  21.       timeNow = getTimer();
  22.       microtime = Number(timeNow) - Number(timeBase) + Number(freeze);
  23.       mts = (microtime / 1000).toString().split(".");
  24.       if(59 < mts[0])
  25.       {
  26.          check = 1;
  27.       }
  28.       atime[6] = mts[1].substr(0,3);
  29.       if(atime[6].toString().length < 3)
  30.       {
  31.          atime[6] = "0" add atime[6];
  32.       }
  33.       atime[4] = mts[0];
  34.       if(atime[4].toString().length < 2)
  35.       {
  36.          atime[4] = "0" add atime[4];
  37.       }
  38.       if(atime[4].toString().length < 1)
  39.       {
  40.          atime[4] = "00";
  41.       }
  42.       if(59 < atime[4])
  43.       {
  44.          atime[2] = Number(atime[2]) + Number(1);
  45.          atime[4] = "00";
  46.       }
  47.       if(atime[2].toString().length < 2)
  48.       {
  49.          atime[2] = "0" add atime[2].toString();
  50.       }
  51.       if(59 < atime[2])
  52.       {
  53.          atime[0] = Number(atime[0]) + Number(1);
  54.          atime[2] = "00";
  55.       }
  56.       if(atime[0].toString().length < 2)
  57.       {
  58.          atime[0] = "0" add atime[0];
  59.       }
  60.       if(atime[0].toString().length < 1)
  61.       {
  62.          atime[0] = "00";
  63.       }
  64.       time = atime.join("");
  65.    }
  66. }
  67. atime = new Array();
  68. atime[0] = "00";
  69. atime[1] = ".";
  70. atime[2] = "00";
  71. atime[3] = ".";
  72. atime[4] = "00";
  73. atime[5] = ".";
  74. atime[6] = "000";
  75.